/**
 * Created by Celebration-Grey on 2017/5/6.
 */
function Huiasidedisplay(){
	if($(window).width()>=768){
		$(".Hui-aside").show()
	}
}

$(function(){
	Huiasidedisplay();
	var resizeID;
	$(window).resize(function(){
		clearTimeout(resizeID);
		resizeID = setTimeout(function(){
			Huiasidedisplay();
		},500);
	});

	$(".nav-toggle").click(function(){
		$(".Hui-aside").slideToggle();
	});
	$(".Hui-aside").on("click",".menu_dropdown dd li a",function(){
		if($(window).width()<768){
			$(".Hui-aside").slideToggle();
		}
	});
	$.Huifold(".menu_dropdown dl dt",".menu_dropdown dl dd","fast",1,"click");
});
function leftDropdown(obj){
	var host = window.location.host,
		url = location.href,
		domain = "http://"+host+"/",
		menu = url.replace(domain,"");
	$(obj).each(function(){
		var current = $(this).find("a");
		$(this).removeClass("current");
		if(menu == $(current[0]).attr("href")){
			$(this).addClass("current");
		}
	});
}
$(function(){

	$.Huihover('.codeView');


	$(window).on("scroll",backToTopFun);
	backToTopFun();

	leftDropdown(".menu_dropdown ul li");
});